﻿using Swashbuckle.SwaggerGen.Generator;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Swashbuckle.Swagger.Model;

namespace GanQL.Web.Infrastructure.Swaggers
{
    public class GlobalParameterOperationFilter : IOperationFilter
    {
        public void Apply(Operation operation, OperationFilterContext context)
        {
            if (operation.Parameters == null)
                operation.Parameters = new List<IParameter>();

            operation.Parameters.Add(new NonBodyParameter
            {
                Name = "TenantId",
                In = "header",
                Default = "a3a4a4ec-5569-4b9b-f1fb-39dc32a6e5e1",
                Description = "租户ID",
                Required = true,
                Type = "string"
            });
        }
    }
}
